Skip to content

Conversation

@ErikPre
Copy link
Collaborator

@ErikPre ErikPre commented Nov 4, 2025

Merging into Importer Rework branch

@ErikPre ErikPre requested review from Copilot and tpurschke November 4, 2025 15:02
@ErikPre
Copy link
Collaborator Author

ErikPre commented Nov 4, 2025

@tpurschke Ich habe die update sql erstmal 9.1.1.sql genannt, ich bin mir da nicht sicher in welche version und datei die kommt

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds a customizable color scheme feature to the UI, allowing users to select from predefined color schemes (blue, green, red, purple). The changes enable dynamic theming of the navigation bar and headings through CSS variables.

  • Introduced ColorScheme class with predefined color schemes and properties for gradient colors
  • Added color scheme selection UI in settings with persistence to configuration
  • Updated CSS to use CSS variables for dynamic color theming

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
roles/lib/files/FWO.Config.Api/Data/ColorScheme.cs New class defining available color schemes with hex values and a lookup method
roles/lib/files/FWO.Config.Api/Data/ConfigData.cs Added ColorScheme property to persist user's color scheme selection
roles/ui/files/FWO.UI/Services/ColorThemeService.cs New service for managing user color mode state (appears unused in this PR)
roles/ui/files/FWO.UI/Shared/NavigationMenu.razor Applied color scheme CSS variables to navigation bar for dynamic theming
roles/ui/files/FWO.UI/Pages/Settings/SettingsDefaults.razor Added UI dropdown for color scheme selection with save functionality
roles/ui/files/FWO.UI/wwwroot/css/site.css Updated gradient and heading styles to support CSS variables with fallbacks
roles/database/files/upgrade/8.8.11.sql Database migration adding localized text entries for color schemes
roles/database/files/sql/idempotent/fworch-texts.sql Added localized text entries for color scheme UI labels

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 3 to 4
INSERT INTO txt VALUES ('color_scheme_standard', 'German', 'Standard Farbschema');
INSERT INTO txt VALUES ('color_scheme_standard', 'English', 'Standard Color Scheme');
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The database migration includes text entries for 'color_scheme_standard', but this color scheme name doesn't exist in the ColorScheme.AvailableSchemes list. The actual default scheme is named 'color_scheme_blue'. Either add 'color_scheme_standard' as an available scheme or remove these unused text entries.

Suggested change
INSERT INTO txt VALUES ('color_scheme_standard', 'German', 'Standard Farbschema');
INSERT INTO txt VALUES ('color_scheme_standard', 'English', 'Standard Color Scheme');

Copilot uses AI. Check for mistakes.
{
configData.DefaultLanguage = selectedLanguage.Name;
configData.ColorScheme = selectedColorScheme.Name;
StateHasChanged();
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Calling StateHasChanged() in the middle of the Save() method is unnecessary and could cause premature re-rendering before the save operation completes. If a state refresh is needed, it should be called after all data modifications are complete, or removed entirely if the framework handles it automatically after the async operation completes.

Suggested change
StateHasChanged();

Copilot uses AI. Check for mistakes.
Comment on lines 33 to 42
bool allGood = false;
if (_UserColorModes.TryAdd(key, mode))
{
allGood = true;

}
else
{
allGood = _UserColorModes.TryUpdate(key, mode, _UserColorModes[key]);
}
Copy link

Copilot AI Nov 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both branches of this 'if' statement write to the same variable - consider using '?' to express intent better.

Suggested change
bool allGood = false;
if (_UserColorModes.TryAdd(key, mode))
{
allGood = true;
}
else
{
allGood = _UserColorModes.TryUpdate(key, mode, _UserColorModes[key]);
}
bool allGood = _UserColorModes.TryAdd(key, mode)
? true
: _UserColorModes.TryUpdate(key, mode, _UserColorModes[key]);

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@tpurschke tpurschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see inline comments - @Y4nnikH maybe you can also have a look at Erik's 2 PRs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all changes to txt table are made only in roles/database/files/sql/idempotent/fworch-texts.sql

@tpurschke
Copy link
Contributor

@tpurschke Ich habe die update sql erstmal 9.1.1.sql genannt, ich bin mir da nicht sicher in welche version und datei die kommt

I do not really see any file with that name but we do not need it anyway. Also the file 8.8.11 should be removed

@tpurschke tpurschke marked this pull request as draft November 5, 2025 17:35
@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 7, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
1 New issue

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@ErikPre ErikPre self-assigned this Nov 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants